home *** CD-ROM | disk | FTP | other *** search
/ hornet.scene.org / hornet.scene.org FTP 11-25-2012.zip / hornet.scene.org FTP 11-25-2012 / code / audio / docs / gt2-form.txt < prev    next >
Text File  |  2012-06-16  |  23KB  |  429 lines

  1. *******************************************************************************
  2. *                                                                             *
  3. *           Official GRAOUMF TRACKER module file format .GT2 v1 - v4          *
  4. *                            and old GT modules .GTK                          *
  5. *                                                                             *
  6. *                           By L. de Soras - 11/11/96                         *
  7. *                                                                             *
  8. *******************************************************************************
  9.  
  10.  
  11.  
  12. ===============================================================================
  13.            Format of GT2 modules
  14. ===============================================================================
  15.  
  16.     This format is composed of various chunks. They must follow them (but not
  17. necessarily in order), in this way you can read them easily. Put in your module
  18. just the chunks you need. Intel coders, be careful : all words and double words
  19. are in Motorola format, LSByte stored AFTER MSByte.
  20.     You may NOT expect that the first pattern chunk is 12 bytes after the
  21. pattern set chunk, for example. Although it usually is, this may change in
  22. future releases. In addition, it's possible that a chunk even doesn't exist in
  23. the file. Therefore, you MUST check the chunk ID before accessing the chunk.
  24. Finally, when writing GT2's you set undefined/reserved fields to zeros.
  25.     Note : chunk length can be odd.
  26.  
  27.  
  28.  
  29. General info chunk
  30. ~~~~~~~~~~~~~~~~~~
  31.  
  32.     This is always the first chunk.
  33.  
  34. +--------+-------+------------------------------------------------------------+
  35. |      0 |     3 | 'GT2' File magic                                           |
  36. |      3 |     1 | Version of the format (not in ascii!) :                    |
  37. |        |       |     $01 : G.T. v0.7                                        |
  38. |        |       |     $02 : G.T. v0.726                                      |
  39. |        |       |     $03 : G.T. v0.731                                       |
  40. |      4 |     4 | Chunk size. It's the total length of the chunk, included   |
  41. |        |       | id and this dword.                                         |
  42. +--------+-------+------------------------------------------------------------+
  43. |      8 |    32 | Name of the module.                                        |
  44. +--------+-------+------------------------------------------------------------+
  45. |     40 |   160 | Small comments, name of the author                         |
  46. +--------+-------+------------------------------------------------------------+
  47. |    200 |     4 | Date                                                       |
  48. |        |       |     Day   : 1 byte                                         |
  49. |        |       |     Month : 1 byte                                         |
  50. |        |       |     Year  : 1 word                                         |
  51. +--------+-------+------------------------------------------------------------+
  52. |    204 |    24 | Name of the tracker of creation                            |
  53. +--------+-------+------------------------------------------------------------+
  54. |    228 |     2 | Initial speed (Beat length * 6)                            |
  55. |    230 |     2 | Initial tempo (BPM)                                        |
  56. +--------+-------+------------------------------------------------------------+
  57. |    232 |     2 | Initial master volume (000..FFF)                           |
  58. |        |       | Shouldn't excess $600. You can calculate it:               |
  59. |        |       |     MasterVol = $3000 / (NbrTrack + 3)                     |
  60. +--------+-------+------------------------------------------------------------+
  61. |    234 |     2 | Number of voices (just for this panning section)           |
  62. |    236 |   n*2 | Panning for each voice (000..800..FFF)                     |
  63. +--------+-------+------------------------------------------------------------+
  64.  
  65.  
  66.  
  67. Track volume chunk (v4)
  68. ~~~~~~~~~~~~~~~~~~~~~~~
  69.  
  70. +--------+-------+------------------------------------------------------------+
  71. |      0 |     4 | 'TVOL'                                                     |
  72. |      4 |     4 | Chunk size                                                 |
  73. +--------+-------+------------------------------------------------------------+
  74. |      8 |     2 | Number of track volumes defined in this section            |
  75. |     10 |   n*2 | Volume for each track (0000..1000..FFFF)                   |
  76. +--------+-------+------------------------------------------------------------+
  77.  
  78.  
  79.  
  80. Extra-comment chunk (v2)
  81. ~~~~~~~~~~~~~~~~~~~~~~~~
  82.  
  83. +--------+-------+------------------------------------------------------------+
  84. |      0 |     4 | 'XCOM'                                                     |
  85. |      4 |     4 | Chunk size                                                 |
  86. +--------+-------+------------------------------------------------------------+
  87. |      8 |     4 | Extra-comment length                                       |
  88. |     12 |   ECL | Extra-comment                                              |
  89. +--------+-------+------------------------------------------------------------+
  90.  
  91.  
  92.  
  93. Tracker configuration chunk
  94. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95.  
  96.     This chunk is specific to the Graoumf Tracker.
  97.  
  98. +--------+-------+------------------------------------------------------------+
  99. |      0 |     4 | 'TCN1'                                                     |
  100. |      4 |     4 | Chunk size                                                 |
  101. +--------+-------+------------------------------------------------------------+
  102. |      8 |     2 | Version number                                             |
  103. +--------+-------+------------------------------------------------------------+
  104. | Version 0 :                                                                 |
  105. |     10 |     2 | Song position                                              |
  106. |     12 |     2 | line position                                              |
  107. |     14 |     2 | Preset number                                              |
  108. |     16 |     2 | Pattern display type                                       |
  109. |        |       |     0 : Note and instrument                                |
  110. |        |       |     1 : Note, instrument and effect                        |
  111. |        |       |     2 : Note, instrument, effect and volume                |
  112. |     18 |     2 | Curseur position #1 (column number, on screen)             |
  113. |     20 |     2 | Curseur position #2                                        |
  114. |        |       |     0   : Note                                             |
  115. |        |       |     1-2 : Instrument                                       |
  116. |        |       |     3-6 : Effect                                           |
  117. |        |       |     7-8 : Volume column                                    |
  118. |     22 |     2 | Flags :                                                    |
  119. |        |       |     Bit 0-1 : Play mode                                    |
  120. |        |       |         00 = stop                                          |
  121. |        |       |         01 = play song                                     |
  122. |        |       |         10 = play pattern                                  |
  123. |        |       |     Bit 2   : Edit                                         |
  124. |     24 |     2 | Lower octave on keyboard (0-6)                             |
  125. |     26 |     2 | Line step                                                  |
  126. |     28 |     2 | Instrument number                                          |
  127. |     30 |     2 | Sample number                                              |
  128. +--------+-------+------------------------------------------------------------+
  129. |     32 |  32*2 | Number of tracks displayed for each preset                 |
  130. |     96 | 32*16 | Name of each preset (16 char strings)                      |
  131. |    608 |32*32*2| 32 track numbers for 32 presets                            |
  132. +--------+-------+------------------------------------------------------------+
  133. |   2654 |     4 | Bits 0-31 : 0 = muted track, 1 = track ok                  |
  134. +--------+-------+------------------------------------------------------------+
  135.  
  136.  
  137.  
  138. Song chunk
  139. ~~~~~~~~~~
  140.  
  141. +--------+-------+------------------------------------------------------------+
  142. |      0 |     4 | 'SONG'                                                     |
  143. |      4 |     4 | Chunk size                                                 |
  144. +--------+-------+------------------------------------------------------------+
  145. |      8 |     2 | Song length                                                |
  146. |     10 |     2 | Song repeat point                                          |
  147. +--------+-------+------------------------------------------------------------+
  148. |     12 |    SL | Song data : pattern numbers, in words                      |
  149. +--------+-------+------------------------------------------------------------+
  150.  
  151.  
  152.  
  153. Pattern set chunk
  154. ~~~~~~~~~~~~~~~~~
  155.  
  156. +--------+-------+------------------------------------------------------------+
  157. |      0 |     4 | 'PATS'                                                     |
  158. |      4 |     4 | Chunk size                                                 |
  159. +--------+-------+------------------------------------------------------------+
  160. |      8 |     2 | Number of tracks for all the song.                         |
  161. |        |       | Perhaps in a future version, patterns will have different  |
  162. |        |       | numbers of tracks, and this value will be the max.         |
  163. +--------+-------+------------------------------------------------------------+
  164. |     10 |     2 | Number of patterns saved                                   |
  165. +--------+-------+------------------------------------------------------------+
  166.  
  167.  
  168.  
  169. Pattern chunk
  170. ~~~~~~~~~~~~~
  171.  
  172. +--------+-------+------------------------------------------------------------+
  173. |      0 |     4 | 'PATD'                                                     |
  174. |      4 |     4 | Chunk size                                                 |
  175. +--------+-------+------------------------------------------------------------+
  176. |      8 |     2 | Pattern number                                             |
  177. |     10 |    16 | Pattern name                                               |
  178. +--------+-------+------------------------------------------------------------+
  179. |     26 |     2 | Codage version : 0                                         |
  180. +--------+-------+------------------------------------------------------------+
  181. | Version 0 (full pattern) :                                                  |
  182. |     28 |     2 | Number of lines                                            |
  183. |     30 |     2 | Number of tracks saved. This word is used only out of a    |
  184. |        |       | module (single chunk) for the moment. Set the same value   |
  185. |        |       | in all patterns                                            |
  186. |     32 | 5*L*T | Pattern, raw data, 5 bytes/note : NN II EEEE VV            |
  187. |        |       |     NN   : Note (24-127), 48 is middle C-2. 0 for no note  |
  188. |        |       |     II   : Instrument (1-255). 0 for no instrument         |
  189. |        |       |     EEEE : Effect, see doc for more details. 0 for no FX   |
  190. |        |       |     VV   : Volume (1-255). 0 for no volume                 |
  191. +--------+-------+------------------------------------------------------------+
  192.  
  193.  
  194.  
  195. Instrument set chunk
  196. ~~~~~~~~~~~~~~~~~~~~
  197.  
  198. +--------+-------+------------------------------------------------------------+
  199. |      0 |     4 | 'ORCH'                                                     |
  200. |      4 |     4 | Chunk size                                                 |
  201. +--------+-------+------------------------------------------------------------+
  202. |      8 |     2 | Number of instruments saved                                |
  203. +--------+-------+------------------------------------------------------------+
  204.  
  205.  
  206.  
  207. Instrument chunk
  208. ~~~~~~~~~~~~~~~~
  209.  
  210. +--------+-------+------------------------------------------------------------+
  211. |      0 |     4 | 'INST'                                                     |
  212. |      4 |     4 | Chunk size (316)                                           |
  213. +--------+-------+------------------------------------------------------------+
  214. |      8 |     2 | Instrument number (1-255)                                  |
  215. |     10 |    28 | Instrument name                                            |
  216. +--------+-------+------------------------------------------------------------+
  217. |     38 |     2 | Instrument type (0 = sample)                               |
  218. +--------+-------+------------------------------------------------------------+
  219. |     40 |     2 | Volume (0-255)                                             |
  220. +--------+-------+------------------------------------------------------------+
  221. |     42 |     2 | Autopanning (000..800..FFF)                                |
  222. |        |       | -1 : no autopannig                                         |
  223. +--------+-------+------------------------------------------------------------+
  224. |     44 |     2 | Volume envelope number (0 = no env)                        |
  225. |     46 |     2 | Tone envelope number (0 = no env)                          |
  226. |     48 |     2 | Pan envelope number (0 = no env)                           |
  227. +--------+-------+------------------------------------------------------------+
  228. |     50 |    10 | Reserved, must be set to 0                                 |
  229. +--------+-------+------------------------------------------------------------+
  230. | For n=0 to 127 :                                                            |
  231. | 60+n*2 |     1 | Sample number for MIDI note n                              |
  232. | 61+n*2 |     1 | Transposition for note n, signed byte                      |
  233. +--------+-------+------------------------------------------------------------+
  234.  
  235.  
  236.  
  237. Sample chunk
  238. ~~~~~~~~~~~~
  239.  
  240. +--------+-------+------------------------------------------------------------+
  241. |      0 |     4 | 'SAMP'                                                     |
  242. |      4 |     4 | Chunk size                                                 |
  243. +--------+-------+------------------------------------------------------------+
  244. |      8 |     2 | Sample number (1-255)                                      |
  245. |     10 |    28 | Sample name                                                |
  246. +--------+-------+------------------------------------------------------------+
  247. |     38 |     2 | Bit 0 : 0 = mono, 1 = stereo                               |
  248. |        |       | Bit 1 : 0 = normal loop, 1 = ping-pong loop (v3)           |
  249. +--------+-------+------------------------------------------------------------+
  250. |     40 |     2 | Autopanning (000..800..FFF)                                |
  251. +--------+-------+------------------------------------------------------------+
  252. |     42 |     2 | Number of bits (8 or 16)                                   |
  253. |     44 |     2 | Sample frequency in Hz (2000-65000)                        |
  254. +--------+-------+------------------------------------------------------------+
  255. |     46 |     4 | Length (in bytes), even                                    |
  256. |     50 |     4 | Repeat start (in bytes), even                              |
  257. |     54 |     4 | Repeat length (in bytes), even                             |
  258. +--------+-------+------------------------------------------------------------+
  259. |     58 |     2 | Volume (0-255)                                             |
  260. +--------+-------+------------------------------------------------------------+
  261. |     60 |     2 | Finetune (-8..+7 -> -1..+7/8 halftone)                     |
  262. +--------+-------+------------------------------------------------------------+
  263. |     62 |     2 | Codage version : 0                                         |
  264. +--------+-------+------------------------------------------------------------+
  265. | Version 0 (raw data) :                                                      |
  266. |     64 |     L | Sample data, signed bytes or words                         |
  267. +--------+-------+------------------------------------------------------------+
  268.  
  269.  
  270.  
  271. Envelope chunk
  272. ~~~~~~~~~~~~~~
  273.  
  274. +--------+-------+------------------------------------------------------------+
  275. |      0 |     4 | 'VENV' (volume),                                           |
  276. |        |       | 'TENV' (tone) or                                           |
  277. |        |       | 'PENV' (panning)                                           |
  278. |      4 |     4 | Chunk size                                                 |
  279. +--------+-------+------------------------------------------------------------+
  280. |      8 |     2 | Envelope number                                            |
  281. |     10 |    20 | Envelope name                                              |
  282. +--------+-------+------------------------------------------------------------+
  283. |     30 |     2 | 'Key Off' offset (from data start)                         |
  284. +--------+-------+------------------------------------------------------------+
  285. |     32 | CS-32 | Envelope data                                              |
  286. +--------+-------+------------------------------------------------------------+
  287.  
  288.     Vol/Tone/Pan envelope codes:
  289.         00        : End
  290.         01 + word : Jump
  291.         02 + word : Wait
  292.         03 + byte : Set Counter
  293.         04        : Loop
  294.         05        : Key Off
  295.  
  296.     Volume envelope codes :
  297.         80 + word : Set Volume (16384 = 100%, max = 32767)
  298.         81 + word : Set Volume step
  299.         82 + word : Set Volume speed
  300.         83        : Tremolo On
  301.         84        : Tremolo Off
  302.         85 + byte : Set Tremolo Width
  303.         86 + byte : Set Tremolo Speed
  304.         87        : Tremor On
  305.         88        : Tremor On
  306.         89        : Set Tremor Time 1
  307.         8A        : Set Tremor Time 2
  308.  
  309.     Tone envelope codes :
  310.         A0 + word : Set Tone (4096 = normal period)
  311.         A1 + word : Set Tone step
  312.         A2 + word : Set Tone speed
  313.         A3        : Vibrato On
  314.         A4        : Vibrato Off
  315.         A5 + byte : Set Vibrato Width
  316.         A6 + byte : Set Vibrato Speed
  317.  
  318.     Panning envelope codes :
  319.         C0 + word : Set Panning (2048 = normal position)
  320.         C1 + word : Set Pan step
  321.         C2 + word : Set Pan speed
  322.  
  323.     Volume = Volume * (EnvVol+Tremolo)/16384 * TremorFlag
  324.     Period = Period * (Tone+Vibrato)/4096
  325.     Panning = Panning + (PanEnv-2048)*(2048-abs(Panning-2048))/2048
  326.  
  327.  
  328.  
  329. End chunk (v3)
  330. ~~~~~~~~~~~~~~
  331.  
  332.     This chunk should end the module and must always exist.
  333.  
  334. +--------+-------+------------------------------------------------------------+
  335. |      0 |     4 | 'ENDC'                                                     |
  336. |      4 |     4 | Chunk size                                                 |
  337. +--------+-------+------------------------------------------------------------+
  338. |      8 |     4 | Total module size                                          |
  339. +--------+-------+------------------------------------------------------------+
  340.  
  341.  
  342.  
  343.  
  344.  
  345. ===============================================================================
  346.     Format of old GTK modules
  347. ===============================================================================
  348.  
  349. Structure des infos samples :
  350. ╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣
  351.  
  352.     rsreset
  353. name_s:    rs.b    28    ; Nom du sample
  354.     rs.w    7    ; Libre (enfin, réservé pour des améliorations futures)
  355.             ; Doit être mis à 0 !
  356. autobal_s:    rs.w    1    ; Balance automatique, -1 = rien
  357. nbits_s:    rs.w    1    ; 1 = 8 bits, 2 = 16 bits
  358. fech_s:    rs.w    1    ; Fréquence d'échantillonnage du sample (8363 Hz par défaut)
  359. length_s:    rs.l    1    ; Longueur du sample, paire
  360. repeat_s:    rs.l    1    ; Point de bouclage, pair
  361. replen_s:    rs.l    1    ; Longueur de boucle, paire
  362. vol_s:    rs.w    1    ; Volume ($0 à $100)
  363. ftune_s:    rs.w    1    ; Finetune (-8 à +7)
  364. size_s:    rs    1    ; Total : 64 octets
  365.  
  366. ***    Toutes les valeurs sont au format Motorola et non Intel :     ***
  367. ***    l'octet de poids fort en premier, et l'octet de poids faible  ***
  368. ***    faible en dernier (sens de la lecture).                       ***
  369.  
  370.     A titre indicatif, les versions de format 1 et 2 ne diffèrent que par cette
  371. structure :
  372.         - 1 : Taille totale 48 octets, le nom fait 32 caractères et il n'y a ni
  373.               balance, ni nombre de bits, ni fréquence d'échantillonnage.
  374.         - 2 : Toujours 48 octets, le nom passe à 28 caractères, pas de balance.
  375.  
  376.  
  377.  
  378. Structure du module :
  379. ╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣╣
  380.  
  381. Nom    Offset        Taille        Fonction
  382. gtk_id:        0          3        Identificateur "GTK"
  383. form_num:        3          1        Numéro de format : le numéro 3
  384. name:        4         32        Nom ASCII (pas de zéro)
  385. comment:       36        160        Commentaire ASCII (pas de zéro)
  386. n_spl:      196          2        Nombre d'instruments (0 à 255)
  387. n_lines:      198          2        Nombre de lignes/pattern (1 à 256)
  388. n_trk:      200          2        Nombre de voies/pattern (1 à 32 ?? ou + ??)
  389. songlen:      202          2        Longueur de la song (1 à 256)
  390. songrep:      204          2        Point de bouclage dans la song (0 à songlen-1)
  391. infos_s:      206        n_spl*size_s    Descriptif des instruments (à partir du numéro 1)
  392. ...
  393. song:      n_spl*size_s    256*2        La song (1 mot = 1 pattern), de la position 0 jusqu'à 255
  394.     + 206
  395. ...
  396. patterns:      n_spl*size_s    (npatmax+1)*n_l*n_t*?    Les patterns, de 0 à npatmax.
  397.     + 718                ? peut être 4 (v3) ou 5 (v4)
  398. ...
  399. samples:      n_spl*size_s            Les samples, 8 ou 16 bits signés
  400.     + (npatmax+1)*n_l*n_t*?
  401.     + 718
  402.  
  403.     le numéro du dernier pattern sauvé est le plus grand pattern de la song, de
  404. 0 à songlen-1.
  405.     Chaque pattern est subdivisé en lignes, et chaque ligne en colonnes. On
  406. obtient ainsi chaque note, codée sur 4 (ou 5) octets :
  407.  
  408.     NN II EE EE (VV)
  409.  
  410.     - NN indique le numéro de la note, de 24 (C-0) à 83 (B-4). 0 = pas de note,
  411.     - II indique le numéro de l'instrument. 0 = pas d'instrument,
  412.     - EEEE représente l'effet et son paramètre. Pour plus de précision dessus,
  413.       se reporter à la documentation du tracker.
  414.     - VV, pour la version 4, indique le volume de la piste (1-255). 0 = pas de
  415.       changement de volume.
  416.  
  417.  
  418.  
  419.     Attention, ce format est un format de préversion! Je ne garantis pas que la
  420. version finale sera telle qelle est décrite ici, alors avant de charger un
  421. module de ce type, contrôlez bien le numéro.
  422.     Vous pouvez obtenir la dernière version de Graoumf Tracker (pour Atari
  423. Falcon 030) auprès de son auteur :
  424.  
  425.                         Laurent de Soras
  426.                         92 avenue Albert 1er
  427.                         92500 Rueil-Malmaison
  428.                         FRANCE
  429.